package org.platform.controller.diagnose;

import com.mc.mic.core.bo.CmdBO;
import com.mc.mic.core.bus.provider.BaseServiceRegister;
import org.platform.mo.csmo.cmd21002.TestDiagnoseTaskStopRequestParam;
import org.platform.mo.csmo.cmd21002.TestDiagnoseTaskStopResponseParam;
import org.platform.mo.csmo.cmd41001.AddTaskRequestParam;
import org.platform.mo.csmo.cmd41001.AddTaskResponseParam;
import org.platform.mo.csmo.cmd41002.DelTaskRequestParam;
import org.platform.mo.csmo.cmd41002.DelTaskResponseParam;
import org.platform.mo.csmo.cmd41003.ModifyTaskRequestParam;
import org.platform.mo.csmo.cmd41003.ModifyTaskResponseParam;
import org.platform.mo.csmo.cmd41004.QueryTaskRequestParam;
import org.platform.mo.csmo.cmd41004.QueryTaskResponseParam;
import org.platform.mo.csmo.cmd41016.QueryDiagnoseTaskRequestParam;
import org.platform.mo.csmo.cmd41016.QueryTaskDiagnoseResponseParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author FengJie
 * @date 2018/6/8
 */
@RestController
public class DiagnoseTaskRegister extends BaseServiceRegister {
    /**
     * 新建任务（41001）
     *
     * @param cmdBO
     * @return
     */
    @PostMapping(value = "41001")
    public CmdBO addTask(@RequestBody CmdBO<AddTaskRequestParam, AddTaskResponseParam> cmdBO) {
        return super.serviceExecutor(cmdBO);
    }

    /**
     * 删除任务（41002）
     *
     * @param cmdBO
     * @return
     */
    @PostMapping(value = "41002")
    public CmdBO delTask(@RequestBody CmdBO<DelTaskRequestParam, DelTaskResponseParam> cmdBO) {
        return super.serviceExecutor(cmdBO);
    }

    /**
     * 修改任务（41003）
     *
     * @param cmdBO
     * @return
     */
    @PostMapping(value = "41003")
    public CmdBO modifyTask(@RequestBody CmdBO<ModifyTaskRequestParam, ModifyTaskResponseParam> cmdBO) {
        return super.serviceExecutor(cmdBO);
    }

    /**
     * 查询任务（41004）
     *
     * @param cmdBO
     * @return
     */
    @PostMapping(value = "41004")
    public CmdBO queryTask(@RequestBody CmdBO<QueryTaskRequestParam, QueryTaskResponseParam> cmdBO) {
        return super.serviceExecutor(cmdBO);
    }

    /**
     * 查询诊断任务集合(41016)
     */
    @PostMapping(value = "41016")
    public CmdBO queryTaskList(@RequestBody CmdBO<QueryDiagnoseTaskRequestParam, QueryTaskDiagnoseResponseParam> cmdBO) {
        return super.serviceExecutor(cmdBO);
    }


    /**
     * 中止测试故障诊断任务(21002)
     *
     * @param cmdBO
     * @return
     */
    @PostMapping(value = "21002")
    public CmdBO stopTestDiagnose(@RequestBody CmdBO<TestDiagnoseTaskStopRequestParam, TestDiagnoseTaskStopResponseParam> cmdBO) {
        return super.serviceExecutor(cmdBO);
    }


}
